package easier.popup.view;

import android.view.View;

public class PopInPopupWindowFactory extends PopupWindowFactory {

    public PopInPopupWindowFactory( View view ) {

        super( view );
    }

    /**
     * PopupWindow 在 PopupWindow 中显示时,低版本会报异常,使用该方法兼容
     *
     * @param parentAnchor 父 popupwindow 锚点
     * @param anchor       子 popupwindow 锚点
     */
    public void showAsDropDown( View parentAnchor, View anchor ) {

        onWindowBeforeShow( mWindow, anchor );
        mWindow.showAsDropDown( parentAnchor, anchor.getLeft(), anchor.getBottom() );
    }

    public void showAtLocation( View parentAnchor, View parent, int gravity, int x, int y ) {

        onWindowBeforeShow( mWindow, parent );
        mWindow.showAtLocation( parentAnchor, gravity, parent.getLeft(), parent.getBottom() );
    }
}
